<?php
$this->breadcrumbs=array(
	'Main',
);?>
<h1><?php echo $this->id . '/' . $this->action->id; ?></h1>
<style type="text/css">
.image {
	margin: 5px;
	float: left;
}
.clear {
	clear: both;
}
.loai {
	padding-top: 40px;
}

.floatleft {
	float: left;
	width: 400px;
}
.probutton {
	-moz-box-shadow:inset 0px 1px 0px 0px #caefab;
	-webkit-box-shadow:inset 0px 1px 0px 0px #caefab;
	box-shadow:inset 0px 1px 0px 0px #caefab;
	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #77d42a), color-stop(1, #5cb811) );
	background:-moz-linear-gradient( center top, #77d42a 5%, #5cb811 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#77d42a', endColorstr='#5cb811');
	background-color:#77d42a;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border-radius:6px;
	border:1px solid #268a16;
	display:inline-block;
	color:#306108;
	font-family:arial;
	font-size:15px;
	font-weight:bold;
	padding:6px 24px;
	text-decoration:none;
	text-shadow:1px 1px 0px #aade7c;
}.probutton:hover {
	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #5cb811), color-stop(1, #77d42a) );
	background:-moz-linear-gradient( center top, #5cb811 5%, #77d42a 100% );
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5cb811', endColorstr='#77d42a');
	background-color:#5cb811;
}.probutton:active {
	position:relative;
	top:1px;
}
/* This imageless css button was generated by CSSButtonGenerator.com */
</style>

<div style="margin-left: 200px;" >
	<div class="floatleft" >
		<img src="<? echo is_file($model->urlimage)?$model->urlimage:"imagebooks/book-icon.png" ?>" alt="" width="70" height="105" class="image" style="padding: 5px;" />
		<div class="loai">
			Name : <?php echo $model->name ?></br>
			Genre : <? foreach( $model->genres as $genre ) 
			echo CHtml::link($genre->name,array('viewgenre', 'idgenre'=>$genre->idgenre)); ?><br />
			Author : avbcasd sa<br />
			Upload by <? echo $model->user->username; ?><br />
		</div>
		<div class="clear"></div>
		<div>
		<?php // Star View Rating
		$this->widget('CStarRating',array(
						'name'=>'rating',
						'value'=>(int)$model->point(),
						'callback'=>"function()
						{	
							$(this).rating('disable');
							var postdata =  {'bookrate':{ 'value':$(this).val(), 'id':\"$model->idbook\" }};// Json
							$.ajax(
							{
								type: 'POST',
								url: '?r=rating/RateIt',
								data: postdata,
								success: function(msg){alert( 'You chose score: ' + msg );},
							}
							);
						}"
						));
		//End CStarRating
		 ?>
			</br>
			<p>Description</p>

			<p><? echo $model->description; ?></p>
		</div>
	</div>
	</br></br>
	<div><? echo CHtml::link('&nbsp;&nbsp;&nbsp; DOWNLOAD &nbsp;&nbsp;',array('download', 'idbook'=>$model->idbook),array('class'=>'probutton')); ?></div>
	<div><? echo CHtml::link('VIEW CONTENT',array('Main/ViewDetailBook', 'idbook'=>$model->idbook),array('class'=>'probutton')); ?></div>
</div>
